package com.learn.demo.lambda.method;

import com.learn.demo.lambda.Person;

import java.util.function.Function;
import java.util.function.Supplier;

/**
 * 构造器引用
 * ClassName::new
 *
 * @author banjiawei
 * @date 2021/06/22
 */
public class ConstructorRef {
    public static void main(String[] args) {
        Supplier<String> supplier = String::new;
        String s = supplier.get();
        System.out.println(s);

        Function<String, String> function = String::new;
        String apply = function.apply("测试构造器引用ClassName::new");
        System.out.println(apply);
    }
}
